package com.freewater.springboot.demo.aop.api.advices.afterreturn;

import org.jetbrains.annotations.NotNull;
import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;
import java.util.Arrays;

public class SimpleAfterReturningAdvice implements AfterReturningAdvice {

    @Override
    public void afterReturning(Object returnValue, Method method, Object @NotNull [] args, Object target) {
        System.out.println("\n" + "当前执行对象：" + target);
        System.out.println("执行方法名称：" + method.getName());
        System.out.println("执行方法参数：" + Arrays.asList(args));
        System.out.println("执行方法的返回值：" + returnValue);
    }
}
